<template>
    <el-row class="login-container" type="flex" justify="center" align="middle">
        <el-form :model="ruleForm2" :rules="rules2"
         status-icon
         ref="ruleForm2" 
         label-position="left" 
         label-width="0px" 
         class="demo-ruleForm login-page">
            <h3 class="title">系统登录</h3>
            <el-form-item prop="username">
                <el-input type="text" 
                    v-model="ruleForm2.username" 
                    auto-complete="off" 
                    placeholder="用户名"
                ></el-input>
            </el-form-item>
                <el-form-item prop="password">
                    <el-input type="password" 
                        v-model="ruleForm2.password" 
                        auto-complete="off" 
                        placeholder="密码"
                    ></el-input>
                </el-form-item>
            <el-form-item style="width:100%;">
                <el-button type="primary" style="width:100%;" @click="handleSubmit" :loading="logining">登录</el-button>
            </el-form-item>
        </el-form>
    </el-row>
</template>

<script>
export default {
    data(){
        return {
            logining: false,
            ruleForm2: {
                username: 'admin',
                password: '123',
            },
            rules2: {
                username: [{required: true, message: '请输入用户名', trigger: 'blur'}],
                password: [{required: true, message: '请输入密码', trigger: 'blur'}]
            },
            checked: false
        }
    },
    created(){
        
        // var baby=new test();
        // this.$router.push("myFlow?FK_Flow=350");
        
    },
    methods: {
        handleSubmit(){
            var handler = new this.HttpHandler("BP.WF.HttpHandler.WF_AppClassic");
            handler.AddPara("TB_No", this.ruleForm2.username);
            handler.AddPara("TB_PW", this.ruleForm2.password);
            var data = handler.DoMethodReturnString("Login_Submit");
            if(data.includes("err")){
                this.$message.error('登录失败');
                return;
            }
            this.$router.push({path:'/start'});
        }
    },
    
};
</script>

<style scoped>
.title{
    text-align: center;
}
.login-container {
    width: 100%;
    height: 100%;
    background-size:100% 100%;
}
.login-page {
    -webkit-border-radius: 5px;
    border-radius: 5px;
    width: 350px;
    padding: 35px 35px 15px;
    background: #fff;
    border: 1px solid #eaeaea;
    box-shadow: 0 0 25px #cac6c6;
}
label.el-checkbox.rememberme {
    margin: 0px 0px 15px;
    text-align: left;
}
</style>